%The function is the answer to the second part of P3b.
%Find a value of r so that the attractor has period 8.
%Plot the figure (and label the value of r ).
function P3a_Part2( t )
x0=0.5;
r=3.55555;                                   % When x0=0.5 and r=3.55555 the atractor has period 8
figure;
y=0:0.0001:1;
z1=r.*y.*(1-y);
plot(y,z1,'b',y,y,':k');                     % Plot f (x) = rx(1-x) vs. x and the diagonal y = x on the same plot
cobweb(x0,r,t);                              % Use the Function cobweb to plot the cobweb
title('r=3.55555');                          % label the value of r 
end

